package com.test.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;




@Entity
@Table
public class TeacherModel {

	private String id;
	private String name;
	private String title;
	
	private EnumTitle enumTitle;	//枚举类型
	
	
	private int a; //不持久化
	
	private Date birthday;	//Date类型定义精度,默认日期+时间
	
	
	
	
	@Enumerated(EnumType.STRING)
	public EnumTitle getEnumTitle() {
		return enumTitle;
	}
	public void setEnumTitle(EnumTitle enumTitle) {
		this.enumTitle = enumTitle;
	}
	@Temporal(TemporalType.TIMESTAMP)
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	@Transient
	public int getA() {
		return a;
	}
	public void setA(int a) {
		this.a = a;
	}
	@Id
	@GeneratedValue(generator="my-uuid")	//使用自定义生成策略,若使用自带的，则只有jpa原始的4种
	@GenericGenerator(name="my-uuid",strategy="uuid")	//hibernate生成策略
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	
	@Column(length=30)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	
	
}
